<?php

namespace Modules\Admin\Http\Controllers;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Spatie\RouteAttributes\Attributes\Get;
use Spatie\RouteAttributes\Attributes\Prefix;

use Modules\Admin\Models\Admin;
#[Prefix('admin')]
class AdminController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    #[Get('/', name: 'admin.dashboard')]
    public function index()
    {

        $admin = Admin::all();
        $initialData = [
            'title' => '这里是后台传递过来的参数',
            'admin' =>  $admin
        ];
        return view('admin::index', compact('initialData'));
    }
}
